generated using the following code,
my.confusion=table(y,Z)
eral format of a confusion matrix with four summary statistics is
low,
ቀTN
FP
FN
TPቁ
(3.27)
confusion matrix, a class labelled by a zero is treated as the
class and a class labelled by a one is treated as the positive class.
FN, and FP thus stand for the true negative number, the true
number, the false negative number, and the false positive number.
ally the negative class is used to represent a class which may not
evere outcome and the positive class is used to denote a class
ay have a severe outcome in a medical practice. For instance, in
agnosis, the negative class represents the benign tumours and the
class represents the malignant tumours. Suppose a confusion
used to evaluate a model for cancer diagnosis. TN is the number
tly classified benign tumours. TP is the number of correctly
malignant tumours. FN is the number of predicted benign
which should be malignant tumours. FP is the number of
malignant tumours which should be benign tumours.
measurements can be calculated based on these four statistics for
ningful interpretation of a classifier. The specificity is the
n of correctly classified negative data points (benign tumours).
tivity is the proportion of correctly classified positive data points
nt tumours). The total accuracy is the proportion of all correctly
data points (tumours). The negative prediction power is the
n of negative predictions which are indeed negative. The positive
n power is the proportion of positive predictions which are indeed
For instance, these five measurements have been included in
3 for the prediction table shown in Table 3.2. Suppose class A
ed the benign tumour group and class B represented the
t tumour group. The accuracy of diagnosing a malignant tumour